<html>
<extend name="Public/base"/>
<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>

    <form action="" method="post" class="form-horizontal">
        <!--  标题  -->
        <div class="form-item">
            <label class="item-label">标题</label>
            <div class="controls">
                <input type="text" class="text input-large" name="title" value="">
            </div>
        </div>

        <!--  消息接收对象  -->
        <div class="form-item">
            <label class="item-label">消息接收对象</label>
            <div class="controls">
                <input type="number" class="text input-large" oninput="searchUser(this)" placeholder="输入手机号筛选用户" value="" style="width: 260px">
                <select name="uid" class="uid">
                    <option value="0">全部用户</option>
                    <volist name="user_list" id="vo">
                        <option value="{$vo.id}">{$vo.username}</option>
                    </volist>
                </select>
            </div>
        </div>

        <!--  内容  -->
        <div class="form-item">
            <label class="item-label">内容</label>
            <div class="controls">
                <label class="textarea input-large" style="width: 1250px;">
                    <textarea name="sys_content">{$info.sys_content}</textarea>
                    {:hook("adminArticleEdit", array("name"=>sys_content,"value"=>$info["sys_content"]))}
                </label>
            </div>
        </div>
        <input type="hidden" value="{:I('id')}" name="id" />
        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        function searchUser(that)
        {
            var mobile = $(that).val();

            var url = "{:U('searchUser')}";
            var options = '<option value="0">全部用户</option>';
            $.post(url, {
                mobile: mobile
            }, function (res){
                if(res.result == 1){
                    var user_list = res.data;
                    user_list.forEach(function (val){
                        options += '<option value="'+ val.id +'">'+ val.username +'</option>';
                    })
                }

                $('.uid').html(options);
            },'json')
        }

        //导航高亮
        highlight_subnav('{:U("Manage/msgList")}');
    </script>
</block>
</html>